{include file="public_head" /}

<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<body class="nav-md">

<div class="container body">


    <div class="main_container">

        {include file="public_sidebar,public_nav" /}

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>
                            规则管理
                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="row">

                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}</h2>
                                <a style="float: right" href="{:url('console/AuthRule/create')}"
                                   class="btn btn-success btn-sm">创建规则</a>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="post" action="">
                                    <table style="border-bottom:1px solid #ddd"
                                           class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr class="success">
                                            <!--<th style="width: 2%; padding: 10px;">-->
                                                <!--<input type="checkbox" class="checkall"-->
                                                       <!--onclick="CheckAll(this.checked);"/>-->
                                            <!--</th>-->
                                            <th class="hidden-xs">id</th>
                                            <th width="250">规则模块</th>
                                            <th width="250">规则名称</th>
                                            <th>规则标识</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {empty name="data"}
                                        <tr><td colspan="7"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>
                                        {/empty}
                                        {volist name="data" id="item"}
                                        <tr rel="rowpid_{$item.topId}">
                                            <!--<td align="center">-->
                                                <!--<input type="checkbox" name="id[]" value="{$item.id}"/>-->
                                            <!--</td>-->
                                            <td class="hidden-xs">{$item.id}</td>
                                            <td style="text-indent:{$item['count']*20}px;" align="left">

                                                {neq name="item.count" value="1"}|&nbsp;--&nbsp;{/neq}{$item.title}

                                            </td>
                                            <td>{$item.title}</td>
                                            <td>{$item.name}</td>
                                            <td>
                                                <a href="{:url('console/AuthRule/update', ['id' => $item['id']])}"
                                                   class="label label-primary">
                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;编 辑
                                                </a>

                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <a href="{:url('console/AuthRule/destroy', ['id' => $item['id']])}"
                                                   class="label label-danger"
                                                   onClick="return confirm('系统会自动删除类别下所有子类别，确定删除吗?')"
                                                >
                                                    <span class="fa fa-times"></span>&nbsp;&nbsp;删 除
                                                </a>
                                            </td>
                                        </tr>
                                        {/volist}
                                        </tbody>
                                        <tbody align="left">
                                        <tr>
                                            <!--<td colspan="7"><span>选择：</span> <a style="color:#428BCA"-->
                                                                                <!--href="javascript:DelAllNone('{:url(\'Console/AuthRule/destroyAll\')}');"-->
                                                                                <!--onclick="return ConfDelAll(0);">选择删除</a>-->
                                            <!--</td>-->
                                        </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>
        <!-- /page content -->
    </div>

</div>

{include file="public_foot" /}
<!-- Datatables-->
<script src="__STATIC__/js/datatables/jquery.dataTables.min.js"></script>
<script src="__STATIC__/js/datatables/dataTables.bootstrap.js"></script>
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>
<script type="text/javascript">
    // list
    $(document).ready(function () {
        $('#datatable').dataTable({
            "deferRender": true,
            // responsive: true,
            "order": [[1, "desc"]],
            "language": {
                "lengthMenu": "每页 _MENU_ 条记录",
                "zeroRecords": "没有找到记录",
                "info": "第 _PAGE_ 页 ( 总共 _PAGES_ 页 )",
                "infoEmpty": "无记录",
                "infoFiltered": "(从 _MAX_ 条记录过滤)",
                "sSearch": "搜索",
                "paginate": {
                    "previous": "上一页",
                    "next": "下一页"
                }
            }
        });

        $('#datatable').dataTable();
        $('#datatable-keytable').DataTable({
            keys: true
        });
        $('#datatable-responsive').DataTable();
        $('#datatable-scroller').DataTable({
            ajax: "__STATIC__/js/datatables/json/scroller-demo.json",
            deferRender: true,
            scrollY: 380,
            scrollCollapse: true,
            scroller: true
        });
        var table = $('#datatable-fixed-header').DataTable({
            fixedHeader: true
        });
    });
</script>